/**
 * 友链模型 
 * 
*/
module.exports = (sequelize, Sequelize) => {
    return sequelize.define("friend_link", {
        id: {
            type: Sequelize.UUID,
            notNull: true,
            primaryKey: true,
            defaultValue: Sequelize.UUIDV4,
            get() { // UUID的自动递增
                return () => {
                    return this.getDataValue('id');
                };
            }
        },
        path: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            comment: '友链地址',
        },
        siteName: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment: '友链名称',
            field:'site_name'
        },
        intro: {
            type: Sequelize.STRING,
            comment: '简介',
        },
        cover: {
            type: Sequelize.STRING,
            notEmpty: true,
            comment: '封面',
        },
        eMail: {
            type: Sequelize.STRING,
            comment: '友链邮箱',
        },
    })
}